Added buffering for views. Many minor fixes