Fix constructor check and small boost in performance

Signed-off-by: Da Xue <dxue@vidyo.com>