Improve error messaging when class is not found