Add tests. Fix some issue with findOrCreate