cleanup list/binary -> integer conversion (thanks @tsloughter)