Fixes bugs in SETTMP/READTMP