object as value: improvements in code style and bug fixes