Added automatic compilation of short kernel, if large kernel fails