Fixed issues identified by @zaspire for merge request.