Select correct template for '404' pages. Fixes #2137