Fixed reduce reduce errors with if-statements