#134 Fixed bug in storing inputs to db.