Applies pull #566 to remove unused vars