Analyzer error handling

Addition to my previous pull request
Quickfix for printing bytecode in case of exception within optimization package