Fixed a NPE bug.

Fixed a NullPointerException where tp'ing then logging out before the tp was completley finished. I may have done the imports wrong.