Fixed bug introduced with contexts creation refactoring