Remove unused argument, fix bug with edge case.