Remove unused vars and spurious calls to message