Rewrited collision handling (fix #1)