Fixed Aero2 bug under windows 7.

And organized some code.