Fixed slight bugs after testing