Initial import
Fixes by Christophe Dupriez