Fixed compilation issues

Type matching and the var and func keywords