Improve filtering and error message stack traces