Whitespace mode
Bug fixes and whitespace clean