Fix error logging

This fixes the error reporting.