bug fixes and whitespace