Fix incorrect exception message

- Thanks @hepin1989