Changed the device creation and legend size