fix errors in code samples noted by @sgalles