Fixed issues highlighted by regression tests