Fixed a syntax error in 'rebuild_permissions'