Haven't tried it, but this looks okay. Will merge into my PR and test in a bit.