Added check, if LayoutParams is instance of MarginLayoutParams