Fixes bug where tooltip position calculated incorrectly