Permission features, bug fixes