fixed some phrase query bugs; found index bug