Fix exception reporting - possible null pointers there