Bug fixed #6, finally tracked it down to the avatar. I also added more debug code