Fixed some button logic. Tidying...

Warning & TODO hunting.