clean up and warning fixes