Fix bug with creating beans.