Gmtselect segmentation error

Merged into master. Give it a spin, please.