Small adjustments in light of testing. Ran static code analysis and consequently changed a few small things.