SWC-694: add test around fixing the content type, and fix bug that a unit test caught