Fixed whitespaces
Added error message when mkstemp fails