several coverity reports corrected in geometry