precise type conversions in sequence

Fix github issue #13