minor updates to both files to fix bugs.