Added more text control, state control, and other minor changes.