Fixed errors in read API.