more small memory fixes in J