generateBlock fix & test