Refactored and fixed a pre-dealing empty Pile bug