Fixed bug in in-place select