Fixed issues mentioned in commits