Input and bound checking.
Cleanup