Fixed some bugs that prevented the recompiler from terminating properly