some bugfixes for the update script (merge r19034 into trunk)