Improved memory manager and refactored code in GLUS.