Fix bug in content view editUrl method and other small refactorings.