Fix overflow in base sketch