Fixing corner cases