Introduce changes and fixes according to @vjt comments