Correct some nil object mistakes