Fix bugs in RTD build

Fix bugs in RTD build.