Fix 'double type define' bug. Add samples.