Fixed content-type register and added test.

@nj: Also good to have tests covering it ;-)