Some code cleanups
Added temporary workaround for spawning