Improved object manager handling. Improved code style.