Handling of optional text. Misc changes.