Fixed the battery inverter so it works when the foreground is white