Fix bug where the last word in a password wouldn't be selected for
capitalisation.