Some more optimizations and removal of redundant code.
Authored by: SumolX 2006-09-19
Parent: [r176]
Child: [r178]