Changed error handling
Updated examples