Get rid of removeIfLast.
Fix windows warnings.