Removed unused functions, fixed warnings.