Fix for safeGetPixel