Cleanup of bcd_lib.c
switch to master