Use nullptr instead of NULL, simplify Peripheral constructor.