Fix for a null pointer exception.