I bought a new MAF sensor and the problem seems to be fixed.

I tried cleaning the old sensor and I checked the wiring before and that did not help.