Revert "Revert "fixed some small issues""

This reverts commit 82f0d02dc10e06de1837d0ed52c5469462b23e75.