Fixed some bugs involving collision and selecting block.