fixed clearfix issue and division by 0

fixed clearfix issue and division by 0