Fix/vik/pg issues

Cherry picked commits from https://github.com/edx/edx-platform/pull/955 , https://github.com/edx/edx-platform/pull/961 , and https://github.com/edx/edx-platform/pull/889 for hotfix.