Show invalid error message once

Fixes #1437, #1440, #1441