fixes and removal of commented-out code