fixed bugs in subset and write_gmt