Reverted rebel's changes but added compatability with his.