Selection tool fix

Fixed and improved selection tool.