Rewrote for 1.0.8.19 support.