fixed regeneration bug and improved trace levels