Fixed two errors in #976