Fixed some bugs. Now there are problems with Mongoid...