Fixing remaining detected bugs created due refactoring