Change to prevent history from dropping lines that had errors or that did not contain commands (e.g., started with #)