Code fixes according to @tadatuta notations