Fixing various bugs during use of the bundle

1) Fixing issue that entity aren't persisted;
2) Further optimize performance;
3) Fixing the JavaScript that wrong locale is deleted by the delete buttons.