Missed moving a couple of variable declarations to top of file.