Fixed example in header. Made example a test to verify its correctness.