It has to be something in the Marlin code. Reloaded the RAMPS firmware and everything is ok.