BF - A bunch of tiny fixes noted by code analyzer.