Fix error handling (mkdir returns 0 when success)