code cleanup / warning fixes