Fixing firebase bugs