Some Bug Fixes