Cleaning up the code a little bit.

This initial clean up run was to take out the security risks Fortify found.