Removed/commented unused code. Fixed warnings.