Fixed rights, deleted unused code