Handle more than 2 states

Add some more assertions on set cells method