Boundary fixes for textbox