Fixes issues #407.

Restores the ability to use interactive mode. Will merge it now to fix master.