Reverted some changes + fix compiling errors