Fixed a regression caused by previous commit. Removed obsolete code.