add unit tests for qual error cases