Adapted for puppet 3.0