added -fno-inline to debug builds and added a lot more checking/cleaning up things when --tmpdir is specified