Added fix for selection state problem, closes #63.