Fixed automatic API port selection
Fixed message field presence check