Fixed issues raised by Stof in PR