Fix misplaced accept and content-type header
Fix test broken in python 2.6 issue