Fixes warnings, removes whitespace, simplifies source code.