backport changes to folsom branch