Minor error handling fix