Fixed some bugs with obstacle spawning