bugfix: avoid conversion from int64_t to int