some minor bug and warning fixes