Fixed several existing bugs.
Fixed a serious but in page loading calculation.