Bug fixes
Revert "Bug fixes"

This reverts commit 8ed94ed834af4e8aeb0f533a0bd538723bcd6c6a.