Minor tweaks to shared code for compile warnings