Fix empty error messages in tests. Closes #301