Fix various nullptr / uniform exceptions

Ref #557 and Ref #558