Corrected an error that prevented a host to be saved if hostname was nil + some mistakes corrected.