Add missing use statements and view format handling.
Code formatting changes.
Bugfixes