Bugfixes

Fixing a couple of stupid bugs & ghettoly enforcing some data integrity
so this actually functions