Fixed piece deletion, added another error check for invalid moves