correctly handle undefined placeholders. tweak to issue #1365