fixed restraints writing bug in gromacs, and added guard for run()