fixed bug where we were doing invalid restore operations on stdin;