Fixed bug, rolled back woraround in commit fc632d64c9d6703826ce729cd3072da465a289cb