Fix reset of attributes with ansi

reported by Christopher Ohlsson (dmnc)