Added flag for input binding.

Added flag for input binding and several other performance updates.