Thanks for spotting this. Fixed and added a unit test.