Added tests for box, fixed regressions