build fix and minor warning fixes