Fixed all bugs to compilable state