improved strange selection behavior for functions.
more small improvements