Fix documentation problems
Fix macro functions