Added better error handling in PDB calls.