Fixed minor things so the code runs