Fix overflow

Signed-off-by: Jakub Skořepa <jakub@skorepa.info>