Added error handling and removed debug statements.

Updated README. Fixed error handling.