Removed almost all warnings from the lib files. Only one left is unreferenced local function has been removed, because it is checked at the end of a file.