Fixed to exit thread properly when e.g. syntax error occured