few bug fixes to latest source branch