Incorporate changes from @jensenb