Fixes for #14

Make test working fine.
Merge pull request #21 from eitos/port_guard

Fixes for #14