Preparing for merge
Resolved merge conflict and restored proper functioning for handle_plan_permissions(). Still need to finish though