Fixing bugs and whitespace