merged 2.0 patch by rduivenvoorde