Fix #19 due to incorrect cast of the number. Add assertion.