More fixes to edge cases