finish fixing mistakes made by a really horrible PR merge from a phone