Fixes null pointer issue.