Fixed issues by @stof