Fix a bug and and revert unnecessary schema changes