Prevent warning when it shouldn't be thrown

Closes issue #1457