Correct some postreSQL Piwik bugs