Stack-print fix
Memory optimization & bugfix