Correct heights for non-full pages
Fixed spacing and overly-verbose conditions
Merging from master