Fixed binary reader/writer data-type bugs