Resolved several problems with views and tables