Added suggestions by Kwpolska.
Forgot to check in part of code.