Added and tested global Primitives. Minor bugfixes