fix undefined warnings