Fixed some exceptions from unchecked null access