Fixed a null reference issue.