Fixes, death refactor.

istype() is null-safe, the nullcheck isn't needed