Fixed casting issue
Fixed size comparison check