Solved some problems with the obstacle generation.