Fix params followed by extension (:id.json for instance). Add tests.