Fixed boundary issues