Fix on getting the document height/width