Fixed range overlap test so that empty selections are also recognized

Change-Id: Ie08f7e7f97ff2d7f52225cf9f598974f25fd871a