Fixed tools window crashing on certain occasions