JK: fixed function calls to log functions.