Fixed Casting Error

Fixed a bug when casting the handle when passing it to the Completion
Port API.