Code cleanup: removed #if 0 blocks and commented-out code in various places