Thanks to Kshking for the patch.