I've just done this here:

https://github.com/QuantumBadger/RedReader/commit/6d0ac079fb0af224741130c2a4c40b02d72bfd84