several fixes for third-party inclusion