[OC-8421] fix errors during rspec run with proper initializations.

Please review and merge.