Some little improves and fixed postgresql dependency problems