Added better handling of exceptions.
Merge remote-tracking branch 'origin/master'