Cleaned up code

Just cleaned up unused variables and fixed warnings.