functional again.

neglected to fix some bugs during previous changes.