fix some issues with side effects in macro arguments