Improved memory management and added execution flags.