fix a few minor bugs where items in c are left on the lua stack accidentially.