Fix undefined variable references in server code

- detected by Sonar, relying on Sonar to verify fix
- latent defects also indicate test coverage gaps
- not addressing the lack of test coverage yet

Change-Id: I1f12070c2f2234217dc97003aeace1b6dbfd03be
Merge "Fix undefined variable references in server code" into develop