Changed size of bitmap, corrected for overflow in for.