Fixed bug with setting shape colour.
Refactored shape selection code, tweaked Line selection