Modify exception headers

Remove redundant headers
Add legacy switch
Add tests