Actually insert it into the database

Also fixed a tiny bug in the database engine..

Signed-off-by: Toon Schoenmakers <nighteyes1993@gmail.com>