bugfixes to older commits in master; improved PGM and ZeroMQ support