fix applying data->env on error.
fix generating page main content without Tag.
merge