Sorry, somehow I managed to submit an older version of this patch. I will send a new pull request for this.