fix for pgsql timestamp
fix all the minor troubles