Fixing nullpointer access.