Gsoc

Hi Manuel

Hopefully, I've merged in the latest changes from Apache trunk.