Multi bucket support
Fix incorrect references
Fix reference error