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

This fixes the bug introduced in PR #866.