Added macros and fixed samples