fixed bad cast which resulted in a crash on "ipsec update"