Fixed getDevice width and height