Core: Fix width calculation issue