Better patch to consider corner case.