Fixes to stop it generating lots of empty lines. Also remove some of the intellij yellow flags