Implemented Thierry P.'s suggestions