Bug Fixes and Error Handling