Fixing application permissions and a few minor thing.