fix local variables in functions

Followup to 3b9f83d.