Various fixes for issues found while developing integration tests (OMS-1...

...67)