additional fixes for https://github.com/Countly/countly-server/issues/98