Fix test to check for correct error