Fix remaining bits of unrefactored code