Fix bugs in sample graph I/O and add switch to output mesh vertices as samples