Fixed the NullPointerException on exit.
Javadoc.