Fix DPI logic