Bug fixes and clean up(trim) user input