Rebase 3 separate commits into one. Fixes #151, fixes #164 and fixes #173. Relates to the s command-mode key, being off by one.