Fix wrong log printing, was throwing an exception