Remove optional permissions to improve gradle automation. Fixes #45