Fix problems intoduced in cc31d07

Hopefully fixes #826