Moved styles into resource dictionaries. Bug fixes