Improvements in $readmem[bh] implementation