QCD aspects of leptoquark production at HERA