Get rid of useless list casting, and useless else statements