Bug Fixes

Fixed some bugs and