Updates according to the comments by Dmitry