Fix null errors

Created methods to separately initialize variables in hostList which get
initialized after hostList is created.