Fix #249: Handle empty selection correctly.
Merge pull request #253 from igrekster/no-selection-fix

Fix #249: Handle empty selection correctly.