Updated autoResize directive.