Fixed bug in ply_extension