Fix functions, add automatic creation of hash variables and values