Improved error handling.
Version 1.0.2