Fixed handling of enums in Lua plugin.

Fixed computation of getNumPrimitives() so that it returns 0 when PrimitiveSet is zero.

Added missing properties to PrimitiveSet serializers