Fixed some collision bugs.

Was in a hurry and got some points wrong. Now it should be fine.