Revert "minor bug fixes"

This reverts commit d258686e7ee173cbf3dbc16802a5c2a74f64de72.
Minor bug fixes