Reduce scope of variables where reasonable. See SEI CERT C Coding Standard [DCL19-C](https://wiki.sei.cmu.edu/confluence/display/c/DCL19-C.+Minimize+the+scope+of+variables+and+functions) Fixed in #210