Fix merge_states not handling accepting states correctly