Tidied up the code generation in places remove unnecessary whitespace.