Made views compatible with new SQL templating approach in melamid.