Correction to NPE when enum property type set to null.

This commit also include unit tests for enum property type in general.
Merge pull request #42 from asaf/enumNPEAndTests

Correction to NPE when enum property type set to null.