fixed 2 small issues in constructor code