Aubie used to do the same thing in the bed. Once she learned commands like "stay", we brought her up and made her stay and be calm. If she was good, she got praises. If she was bad, she was off the bed. She still gets nutty sometimes in the bed, but she now knows to stop when you tell her to.