Fix #315: correct code to read binary file