Gridsearch fixes and Boundary margin init bugfix