Bug fixes for the error module