Solved some weird JPA issues