4th week of GSoC coding. Patchset #2.