Fix bug in the create() function and inside logging functions