Revert "Possible NPE fixes"

This reverts commit e028144a5651f414e4eb9c43df34814bfd81a1d9.