Fixed some bugs

global stuff