(blindly) apply fixes from getnikola/nikola#966 (6c42838)

Signed-off-by: Chris “Kwpolska” Warrick <kwpolska@gmail.com>