Fixed narrowing conversion warnings