Fixed bug that lead to an incomplete read exception