fixed up a few things, including revert for #1678
fixed up a few things, including revert for #1678