Bug Fixes

a couple of bug fixes