Fix #789 interactive mode problem