Fixed a bug with creating new profiles, added first DB tests