fix bug - using bitwise & instead of | when encoding state
Signed-off-by: Mike Day <ncmike@ncultra.org>