Fix issue 1363 and 1376

Just a couple small fixes for #1363 and #1376.

/cc @xaviershay @JonRowe