Fixed ACL calculation and permission checks
Fixed nullpointerexception problem