Just realized a logical error in error handling...