add more null checks just in case.

Also remove a bit of debug spam.