Add coveragerc.
Fix some issues (seems the Pdb is not very consistent with the I/O).