Fixed improper use of read in the loader_ham function