Some error corrections

Make sure the tmp directory exists, or else the downloads won't work
right.