fix cast to uint32. related issue #141