fix some bugs to make stuff more explicitly bound