MOB-2082 Script for fixing buckets

Don't merge it, it's just for CR and then to be run only once
This one is taken from http://stackoverflow.com/a/20411643/1050577