Sf master

Various fixes from SourceForge against 0.3 branch