Fixed a NPE
Fixed another NPE
Fixed another NPE
It works now