Updated error handlers and added inputs checking.