Removed final unused objects and functions, as well as restored a critical line of code