Updated (a little bit optimized) processing of dialog styles.
Also provided some bug fixes.