Bug Fixes

Fixed some bugs