Tests and rgbe fix