Merged changes from main repo

Added some fixes from main repo