Import and fix of 1.0 from Stanford; closes #299