Fix max command size
Add RunCommandHistoryTest