Add some missing definitions and functions