Thanks DalekSec for these patches!