Extended usercode wrapper, fixed IF serialization [ci skip]