Applying Moof's pull request from https://github.com/ooyala/barkeep/pull/500.patch