Corrected several errors resulting from backport