Correction to NPE when enum property type set to null.

This commit also include unit tests for enum property type in general.