Fix bugs writing orders and some styles