Fixed code issue #35 from previous commit