Updated with modifications done on the trunk between revision 1042 and 1392.
NB! To be used with causion. Only very few verifications are done!!!!