Prefetching adjusted (might be too aggressive - needs testing). Some redundant code removed, and variable types adjusted.