Monitor: Added printing error message when monitor initialization is failed.
Tests: added generating monitor ports.