Fixed magic

Fixed magic, added max command, and cleaned up a few files (not the
actual code stability but the look)