Exception handling and removed printStackTrace calls.