Merge folsom changes

this includes one patch that only got merged into folsom. This pull request is required in order to get master merged back into the folsom branch.