Fix dimensions check