Fixed bug in update_contour (contour should only be updated if structure is selected)