Fixed a non-leathal null reference error