Add code fixes according to @tadatuta notations