Remove bug; remove unused end