Fix stack overflow (CITIZENS-457)