Implemented object create/destroy functions.
Added missing pl_object_destroy call.