Revert some of leper's changes because of serious bugs.