Fix perms and build dependencies