Added more skeleton state handling code.