CLOUDIFY-1926 Fix nil problems in unit tests