CAMEL-7023: Polished code with thanks to Babak for suggestions.
Fixed test
Fixed test