improvements for binary/integer conversion