Added a number of fixes for the status code preservation.