Fixed a couple null reference errors