Added $type and $attrs parameters for packs. Thanks @xelax90 for suggestion in #1 .