Add in checks, fix unserialize bug

Empty tables did not unserialize properly
Added in argument checks and a check function
Despite attempt to force it to fail, it didn't cause client side errors?