Bug/dp

Fix #53 and #45. Also added Device detection by physical diagonal.