Guard against null package

Closes #171