Fixes narrowing conversion warnings