Further optimizations, and detail view fixes