used the analyze code feature and came up with a bunch of minor fixes.