Added exception handling, and verbosed return values.