Solution for issue #53

These are the 3 changes for issue #53.