Fixes

Set of small build and runtime fixes