Error handling of wrap around errors and test case added