More bug fixes
Add d_ply