Fixed crash when clicking in an empty region in the view
Fixed bug that made all trajectories be calculated each time a new one was added