[#364] raise error when previous hash is None + fix indentation