fix for #4 and additional fix for #3 bugfix