Fix bucket folding for bucket-types and eleveldb