More efficient bucket resolution

Addressed by #940 .