small fixes to use postgresql9.3