registration_key fix and a few table additions
merge with master