Fix non default request formats

The request format is set before the request instance variables, causing
all rendered templates to use the default request format.

Fixes #560.