Fixed issue with response code parsing and updated tests