Fixed bugs in cache read/write addressing