use the right funcs and types

fixes compile warnings and other potential troubles