fixing neural net code (database part at least).
latest fixes.