Minor fixes to previous commit and warning fixes