core: fix wait method for task manager, fix clone method for memory expression, change how program pointer is handled while emulating