Fixed things and removed debug messages