Few fixes (reverted from commit a287d183efc56ea296d13d6d0d9177d2c6c95cbb)