Made else ifs that appear to have fixed wacky double-deletion problem.