Minor bug fixes
Revert "Minor bug fixes"

This reverts commit 46a1e229a33e28ede4ea25e1a156aa6d6c905cef.
Minor bug fixes