Adding slice distance limiting, fixes #41