Added support for non-interactive shells
Add better error reporting for failed target file loading