Corrected button behaviour

Buttons now disappear at the first and last pages.