Added support for various numbers of texture units.
Fixed entity sticking to ceilings when descending.