there was a sound of footsteps , and the marine stepped hastily out of the way , just in time to avoid the governor , who came popping out of his cabin like a jack out of the box , still attired in a billowing nightshirt and minus his wig .