Fix bug that would show up with dynamicFilename not used.
Fix a problem in the runtime checking.