Fixes in code based on database https://app.asana.com/0/15843277689885/17094782348690