fixed hex to int conversion problem due to difference between ruby 1.8.7 and 1.9.3