Fix several view, scope and controller issues.