Ensured that CompanyId is used correctly throughout the application