Added test for respawn and made some fixes.