Revert "Revert "Fixed issues""

This reverts commit 62d028eac45b61095ca793aee8f912d9a42af151.