Handle additional edge cases for MySQL workaround