fix function pointer casts