Fix bugs with bg