Improved CTRL+Z support