Clean up whitespace, fix some bugs..