Minor alterations for handling errors