Removed debug logging
Fixed a NPE