Patched issue 1160 by adding more rules to handle the unhandled cases  and also updated the tests to reflect the working of the patch