Hello Rui,
I have used the PERCFG &= ~0x40; and it works for my setup and allows the buzzer to sound. With (1.) no buzzer. Without (1.) or (2.) everything works. I have tried may variations. You may want to search CTRL + SHIFT + F to see all the places that PERCFG and P2DIR (priority of UART and Timers) are being changed. The buzzer and the cma3000d accelerometer are two such devices that affect the configuration.
Thanks,