Fix some NPEs and the stupid flower pot bug.