Create pattern workflow, bug fixes and minor improvements.