fixed some bugs in bean generation