Fixes for partial form handling, thanks to patch from Sebastian Richter

Change-Id: I500ab303e50575c8b44cca08b158d0bff7a01665