Refactored acl module, fixed bugs