Patch 3 to master

Patch-3 (fixes) to old master