Fixed segfault + some optimizations.
Merge branch 'master' of github.com:Hexagon/surveil