Fix the bug introdiced in PR #866, where the $format was never set.
Merge pull request #897 from mvrhov/fix_866

Fix the bug introdiced in PR #866, where the $format was never set.