Fixes
Moved some functions