corrections in tmp to make sure portable