fix issue #610 (with test)

boolean i1 val but i8 storage seems the source of the problem
(you could use assertEqual)