Fixes #441 and also #442

very small changes that do both bug fixes.