Fix bug with bucket location detection