post your whole code, configuration fuses and schematic (if possible).

You can try to disable the watchdog timer to see if it solve some part of the problem.