fixed programCounter out of range
improved loadFile()