Fixed error codes processing, tempdir removal