Fixed a bug with the modify command and cleaned up a few places