Added users permissions and misc patches