Fixed minor bugs. Added M example.