Added fix code from soci