Fix out-of-bounds preloadlayout