Fix bug in bucket rotation