Fix functions, bin variables and log messages