Additional fixes for edge cases