Fixed random dir generation in order to avoid 'Permission denied' errors on Linux systems