Fixed bugs with selecting and deleting/overwriting

https://github.com/cwrc/CWRC-Writer/issues/161