Fix flex height and switch math operation