Fix sign extend when returning ints (#306)