* added a fix from Claude and merged a few other changes