Fixes bugs 337, 336

Signed-off-by: Michel Verbraak <michel@1st-setup.nl>