warning fixes and cleanup