Fix some errors with macro expansion