Prevent possible crash for negative height values