Protect error logging with DEBUG property.

Fixes #171.