Fixed possible NPE, added autoRespawn