Fixed a few errors

Still doesn't insert all entries correctly