Fix ref before assign errors in solr module
Fix bad ref to exc in ssh module