Fixed a minor NullPointerException