fix a bug on migrations for Label/Hyperlink changes
fix import errors in test_state and state module