Fixing terminal_max