fix enumIterator
add enumIterator test
fixed enumIterator memory leak
simplified enumIterator
Merge pull request #564 from anovstrup/enumIterator

Fix for issue #553