bugfixes for #18