Fix boundary conditions and allow for negative heights and widths