Minor fixes in code samples

Fixed a typo in first sample and some spacings in second and third.