Fixed syntax error in start-stop code
Fixed various errors in code generation