Better error handling in CreateBlock