Fixed storage behavior, and removed debugging code