Adding support for shadow margin customization and fixing support for subclassing.