Fixes loc segfault, I think.
Merge branch 'segfault'