Bugfix in sorting of semi-transparent objects

Externalized sorting