Bug Fixes

Fixed many bug fixes including: