fixes #149, #150
mentioned in commit a09853ef
mentioned in commit d807ab97
mentioned in commit f9572e41