Fixed many selection bugs.