small fixes for bgra and tests