Fixed issue #1288 and fixed duplicated styles