Print objects when debug is enabled. Closes #540