added mechanism to filter out certain error messages

Closes #474

Accidentally contains commits from other pull request