Tightened error handling