Fixed NoneType bug when accessing new objects