Optimize page loads (fix for #998)

Fix for #998