Change some variables and arguments to references.

Change a variable and an argument to references, because it is a tiny bit
nicer.
Fix bug in logging.

The objectManager::finish() always returned true, even when there were problems
when writing the output file. Change this by actually using the success
variable which was there for exactly that purpose.