Fixed code generation to spawn vector