correct error message and remove redundant check

This commit removes a redundant error check, fixes an error message, and updates the relevant tests.