Fixed a bunch of minor things sonar didnt like.