Fix bug with spawning and with the upgrade manager