Merge ictstudio changes, with adjustments.