Updated error handling and docs