Added cast and coalesce