Fixed up some issues found by @rnavarette