Setting the hostname and cleanup improvements