Several Bug Fixes