Fixed some bugs in liquefaction code