Fixed global issues

Signed-off-by: Peter Mårtensson <veritas.is.me@gmail.com>