Fixed some bugs. Boundary issues still persist