Original Authors:
Martin Bjrklund

Contributors:
Pascal Brisset - provided patches.
