Fix module function implementations a bit