What causes these artifacts around the edges of objects when using the defocus node?
I've sometimes had odd results with the defocus node, particularly with large aperture sizes. See 2d vs 3d Depth of Field.

Try using built in Cycles DoF, which simulates the way light behaves at a lower level. It gives realistic and seamless results without requiring any fussing with the Z buffer:



The only downside is the inability to edit it in post.