fix problems pointed out by @javiereguiluz and @cordoval