Finetuned window.resize to count for 16px window borders too (not sure this is a healthy thing to do in the final version?).