py: Fix casting and printing of small int.