Added tmp-dirchecking and changed small things.