Error Handling and other changes