Fixed time issues
Fixed PG error
Fixed sort order