Move variable declarations to top of blocks.
Do some data-type-related fiddling.