Remove some function-declarations-inside-control-flow

Issue #1206