Fixing several binding-related bugs