Fixed and removed debugging stuff