(Slightly) better error handling