Protect against null prototypes

Closes #62
Do we need a check for `undefined` as well just in case?