Code fixes

See codeReview.xlsx