Fixed some select bugs