Fixed content-type register and added test.

@nj: Fixed in 8582a2d.