Fix some potentials errors

* Update an undefined variable usage in BaseManager::decodeObjectName method
* To avoid some problems with entity constructor, change strategy to obtain state property of an object by using reflection