Workaround for #257 courtesy of @adneal.

Also removed dead code.