Reverted last commit as it wasn't the problem, the way marrub defined the global vars was, fixes a bunch of issues