clean up compiler warning and remove two dead code lines