Added perm command, also fixed a few issues