Adding permission hook, preprocess fix and a few other minor changes