fixed -Wconversion GCC warnings