Fixes #998: Added support for generating canonical URL.