Cannot cast from int primitive to Double type. Just cast to Integer type

... since port is primitive int.

This request also includes the implementation for cloud option when creating client instance.