improved debugging trace messages
clean up coalesce_if_necessary function