make caching still work when there are no view results

also some misc formatting tweaks that snuck in