DEBUG off by default. To activate debug mode, define constant EMS_DEBUG as 1