Fixed JPQL bugs.