added test to reproduce issue 33 and issue 38
fix for issue 33 and issue 38