Improved performance. Fixed bug that may be have wrong height if elements have different  property.