Fix overflows in go solution