Fixed issue with foreign keys. Added register, recover activities.