Fixed bugs with borders and deleting lines