fixes #126
add test for #126
fixes #124
added test for #124
rebuilt with fixes for #124 and #126