Modified binary building functions, changed some info on flags