Casting "insertGetId" as an integer where appropriate. Fixes #377.

Signed-off-by: Ben Corlett <bencorlett@me.com>
Merge pull request #418 from bencorlett/feature/database-insert-get-id

Casting "insertGetId" as an integer where appropriate. Fixes #377.