Fixed a possible NPE, and removed unneeded import.