Fixed Some Null Ref Exceptions