import from sf.net branch swamp_1_6_1