few fixes (thx misterhat)