Fixes some issues with PostgreSQL on couples of queries

If i use that : 

<pre>(CASE WHEN (stat.name IS NOT NULL) THEN stat.name ELSE "none" END) as status_name</pre>

it says that column none doesn't exist