Fix color handling in terminal