Fixed null reference errors that popped up