Fixing dependency issues and allowing heredoc scripts in remote