Some amends/fixes according to Andrey's comments
#79, #82, #67 are completed