bugfixes (passes test_spawn now)