Fixed using stack allocated object in custom port.
Fixed isssue 154.