Fix BlockState destructor
Fix weighted shortest_distance() when a target is given

This fixes #188