Protect against null prototypes

Closes #62