and updated the previous patch accordingly (+ some other minor improvements):