Fixing issues with commit bf1e559ca28e1d96bc93cc6e9b9974e3dfbfbd5b