Corrected some schema creation code, add some default permission levels and fixed python script to work with changes