Fixes error with log function