Fix bug where 'updated'-timestamp was not saved to database
Added tests