Fix bug in credit creation.