Fix two bugs i've noticed