Fix a bug with brick producing