Changed binary to int conversion to suport Erlang R15