Fix incorrect behaviour in Str class
Introduce a new test case to show where the old solution fails