Fix a few bugs.
Add more sequence management studs.