1) JPA query fixes
2) Notifications fixes