Fix janky error

I somehow botched copying from my working branch to upstream. Fixes two errors with the last pull. Will verify results harder this time.